﻿using Lamex.Base;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace Lamex.SystemManager.Model
{
    [DataContract]
    [KnownType("GetKnowTypes")]
    [Serializable]
    [Table(TableName = "Sys_Menu", KeyName = "ID", OutoKeyValue = "ID", sortIndex = "SortCode")]
   public class Sys_MenuInfo
    {
        private string _ID;


        private string _PID = "";
        private string _Name = "";
        private string _Image = "";
        private string _SortCode = "";
        private string _WinformId = "";
        private string _WinformType = "";
        private bool _Enabled;
        private string _SystemType;
        private string _CreateBy = "";
        private string _CreateId = "";
        private DateTime? _CreateTime;
        private string _UpdateBy = "";
        private string _UpDateId = "";
        private DateTime? _UpdateDate;
        private bool _Deleted;
        private string _MainMenu = "";
        private string _EngName = "";
        private string _LastMenu = "";
        private string _WinformName = "";
        private string _OpenFormType = "";



        [DataMember]
        public string ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        [DataMember]
        public string PID
        {
            get { return _PID; }
            set { _PID = value; }
        }
        [DataMember]
        public string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }
        [DataMember]
        public string Image
        {
            get { return _Image; }
            set { _Image = value; }
        }
        [DataMember]
        public string SortCode
        {
            get { return _SortCode; }
            set { _SortCode = value; }
        }
        [DataMember]
        public string WinformId
        {
            get { return _WinformId; }
            set { _WinformId = value; }
        }
        [DataMember]
        public string WinformType
        {
            get { return _WinformType; }
            set { _WinformType = value; }
        }
        [DataMember]
        public bool Enabled
        {
            get { return _Enabled; }
            set { _Enabled = value; }
        }
        [DataMember]
        public string SystemType
        {
            get { return _SystemType; }
            set { _SystemType = value; }
        }
        [DataMember]
        public string CreateBy
        {
            get { return _CreateBy; }
            set { _CreateBy = value; }
        }
        [DataMember]
        public string CreateId
        {
            get { return _CreateId; }
            set { _CreateId = value; }
        }
        [DataMember]
        public DateTime? CreateTime
        {
            get { return _CreateTime; }
            set { _CreateTime = value; }
        }
        [DataMember]
        public string UpdateBy
        {
            get { return _UpdateBy; }
            set { _UpdateBy = value; }
        }
        [DataMember]
        public string UpDateId
        {
            get { return _UpDateId; }
            set { _UpDateId = value; }
        }
        [DataMember]
        public DateTime? UpdateDate
        {
            get { return _UpdateDate; }
            set { _UpdateDate = value; }
        }
        [DataMember]
        public bool Deleted
        {
            get { return _Deleted; }
            set { _Deleted = value; }
        }
        [DataMember]
        public string MainMenu
        {
            get { return _MainMenu; }
            set { _MainMenu = value; }
        }
        [DataMember]
        public string EngName
        {
            get { return _EngName; }
            set { _EngName = value; }
        }
        [DataMember]
        public string LastMenu
        {
            get { return _LastMenu; }
            set { _LastMenu = value; }
        }
        [DataMember]
        public string WinformName
        {
            get { return _WinformName; }
            set { _WinformName = value; }
        }
        [DataMember]
        public string OpenFormType
        {
            get { return _OpenFormType; }
            set { _OpenFormType = value; }
        }
    }

    /// <summary>
    /// 功能菜单节点对象
    /// </summary>
    [Serializable]
    [DataContract]
    public class MenuNodeInfo : Sys_MenuInfo
    {
        private List<MenuNodeInfo> m_Children = new List<MenuNodeInfo>();

        /// <summary>
        /// 子菜单实体类对象集合
        /// </summary>
        [DataMember]
        public List<MenuNodeInfo> Children
        {
            get { return m_Children; }
            set { m_Children = value; }
        }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        public MenuNodeInfo()
        {
            this.m_Children = new List<MenuNodeInfo>();
        }

        /// <summary>
        /// 参数构造函数
        /// </summary>
        /// <param name="menuInfo">MenuInfo对象</param>
        public MenuNodeInfo(Sys_MenuInfo menuInfo)
        {
            base.ID = menuInfo.ID;
            base.Name = menuInfo.Name;
            base.PID = menuInfo.PID;
            base.SortCode = menuInfo.SortCode;
            base.Enabled = menuInfo.Enabled;
            base.WinformId = menuInfo.WinformId;
            base.Image = menuInfo.Image;
        
            base.WinformType = menuInfo.WinformType;
            base.SystemType = menuInfo.SystemType;
            base.CreateBy = menuInfo.CreateBy;
            base.CreateId = menuInfo.CreateId;
            base.CreateTime = menuInfo.CreateTime;
            base.UpdateBy = menuInfo.UpdateBy;
            base.UpDateId = menuInfo.UpDateId;
            base.UpdateDate = menuInfo.UpdateDate;
            base.Deleted = menuInfo.Deleted;
            base.EngName = menuInfo.EngName;
            base.LastMenu = menuInfo.LastMenu;
            base.WinformName = menuInfo.WinformName;
            base.OpenFormType = menuInfo.OpenFormType;
            
        }
    }
}
